def checkoutFormGit(dir,url,branches,credentialsId){
    checkout([$class: 'GitSCM', branches: [[name: branches]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: dir]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: credentialsId, url: url]]])
}